package com.hao.tool.extra.cloud.module.ali;


import com.hao.tool.extra.cloud.module.ali.entity.AlCosDTO;
import com.hao.tool.extra.cloud.module.ali.fac.AlAccessToken;
import com.hao.tool.extra.cloud.module.ali.fac.AlCosFactory;
import com.hao.tool.extra.cloud.module.ali.fac.AlSmsFactory;
import com.hao.tool.extra.cloud.module.ali.fac.AlTextOcrFactory;

/**
 * description
 *
 * @author RuiHaoZ on CMHK.jx
 * @date 2020-07-25 23:56
 */
public class AliCloudManager {

    public static AlSmsFactory buildSms(AlAccessToken accessToken) {
        if (accessToken == null) {
            accessToken = AlAccessToken.build();
        }
        return new AlSmsFactory(accessToken);
    }

    public static AlCosFactory buildCos(AlAccessToken accessToken, AlCosDTO alCosDTO) {
        if (accessToken == null) {
            accessToken = AlAccessToken.build();
        }
        if (alCosDTO == null) {
            alCosDTO = new AlCosDTO();
        }
        return new AlCosFactory(accessToken, alCosDTO);
    }

    public static AlTextOcrFactory buildOci(AlAccessToken accessToken) {
        if (accessToken == null) {
            accessToken = AlAccessToken.build();
        }
        return new AlTextOcrFactory(accessToken, null);
    }

}
